package fr.ensisa.sunspot.event;

import fr.ensisa.sunspot.enums.dwEvents;

public class MouseEvent extends AbstractEvent {
	
	private dwEvents dwEvents;
	private int x;
	private int y;
	private int dwData;

	public MouseEvent(int major, int minor) {
		super(major, minor);
	}

	public dwEvents getDwEvents() {
		return dwEvents;
	}

	public void setDwEvents(dwEvents dwEvents) {
		this.dwEvents = dwEvents;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getDwData() {
		return dwData;
	}

	public void setDwData(int dwData) {
		this.dwData = dwData;
	}
	
    public String toString () {
        StringBuffer tmp = new StringBuffer ();
        tmp.append (super.toString());
        tmp.append(" ");
        tmp.append(dwEvents.value());
        tmp.append(" ");
        tmp.append(x);
        tmp.append(" ");
        tmp.append(y);
        tmp.append(" ");
        tmp.append(dwData);
        return tmp.toString();
    }

    public IEvent clone() {
    	MouseEvent copy = new MouseEvent (getMajor(), getMinor());
        copy.setState(getState());
        copy.setTimeStamp(getTimeStamp());
        copy.setDwEvents(getDwEvents());
        copy.setX(getX());
        copy.setY(getY());
        copy.setDwData(getDwData());
        return copy;
    }

}
